<%
' ---------------------------------------------------------------------------------------
' ----------  Monitor for Proliphix Emulator
' ----------
' ----------  This page allows you to monitor the current state of the values in the Proliphix Emulator
' ----------  Use it to watch for changes made to the underlying values by third party clients, such as DigiLinX drivers
' ----------  This Proliphix monitor is available on my blog, along with information on how to use it:
' ----------  http://wiredright.wordpress.com/
' ----------
' ----------  Written by: Josh Kewley
' ----------              Insario Corporation
' ----------  Version:    4.2.2008
' ---------------------------------------------------------------------------------------
%>
<!--#include file="proliphixConsts.asp"-->
<!--#include file="proliphixMethods.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html><head><style>#mytable tr td {font-size:9pt;font-family:arial;padding-right:20%}</style><meta http-equiv="refresh" content="10"></head><body><form>
<table border=0 id="mytable" name="mytable">
<tbody>
<tr><td>HVAC Mode:</td><td><%OutputMode()%></td></tr>
<tr><td>State:</td><td><%OutputState()%></td></tr>
<tr><td>Fan:</td><td><%OutputFan()%></td></tr>
<tr><td>Fan State:</td><td><%OutputFanState()%></td></tr>
<tr><td>Setback Heat:</td><td><%OutputSetBackHeat()%></td></tr>
<tr><td>Setback Cool:</td><td><%OutputSetBackCool()%></td></tr>
<tr><td>Setback Status:</td><td><%OutputSetBackStatus()%></td></tr>
<tr><td>Current Period:</td><td><%OutputCurrentPeriod()%></td></tr>
<tr><td>Current Class:</td><td><%OutputCurrentClass()%></td></tr>
<tr><td>Active Period:</td><td><%OutputActivePeriod()%></td></tr>
<tr><td>Sensor 1 Name:</td><td><%OutputSensor1Name()%></td></tr>
<tr><td>Local Sensor State:</td><td><%OutputSensorStateLocal()%></td></tr>
<tr><td>Remote Sensor State 1:</td><td><%OutputSensorState1()%></td></tr>
<tr><td>Remote Sensor State 2:</td><td><%OutputSensorState2()%></td></tr>
<tr><td>Include Local In Average:</td><td><%OutputIncludeLocalInAverage()%></td></tr>
<tr><td>Include Sensor 1 In Average:</td><td><%OutputIncludeSensor1InAverage()%></td></tr>
<tr><td>Include Sensor 2 In Average:</td><td><%OutputIncludeSensor2InAverage()%></td></tr>
<tr><td>Sensor 1 Type:</td><td><%OutputSensor1Type()%></td></tr>
<tr><td>Average Temperature:</td><td><%OutputAverageTemp()%></td></tr>
<tr><td>Local Temperature:</td><td><%OutputLocalTemp()%></td></tr>
<tr><td>Sensor 1 Temp:</td><td><%OutputSensor1Temp()%></td></tr>
<tr><td>Uptime:</td><td><%OutputSystemUptime()%></td></tr>
<tr><td>System Time:</td><td><%OutputTime()%></td></tr>
<tr><td>Device Name:</td><td><%OutputDeviceName()%></td></tr>
<tr><td>Model Number:</td><td><%OutputModelNumber()%></td></tr>
<tr><td>Setback Humidity:</td><td><%OutputSetBackHumidity()%></td></tr>
<tr><td>Relative Humidity:</td><td><%OutputRelativeHumidity()%></td></tr>
<tr><td>Sensor 2 Name:</td><td><%OutputSensor2Name()%></td></tr>
<tr><td>Sensor 2 Type:</td><td><%OutputSensor2Type()%></td></tr>
<tr><td>Sensor 2 Temp:</td><td><%OutputSensor2Temp()%></td></tr>
</tbody>
</table>
<script>
 function stripe(id) {
    var even = false;
    // if arguments are provided to specify the colours of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#fff";
    var oddColor = arguments[2] ? arguments[2] : "#DFE9F5";
    var table = document.getElementById(id);
    if (! table) { return; }
    var tbodies = table.getElementsByTagName("tbody");
    for (var h = 0; h < tbodies.length; h++) {
      var trs = tbodies[h].getElementsByTagName("tr");
      for (var i = 0; i < trs.length; i++) {
        // avoid rows that have a class attribute or backgroundColor style
        if (! hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
          var tds = trs[i].getElementsByTagName("td");
          for (var j = 0; j < tds.length; j++) {
            var mytd = tds[j];
            // avoid cells that have a class attribute or backgroundColor style
            if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
              mytd.style.backgroundColor = even ? evenColor : oddColor;
            }
          }
        }
        if(tds && tds.length>0) {even =  ! even};
      }
    }
  }
  function hasClass(obj) {
    // this function is needed to work around
    // a bug in IE related to element attributes
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }
  stripe('mytable');
</script>
</form>
</body></html>
